package match

import (
	"fmt"
	"math/rand"
	"sanguo/node/node_team/com"
	"time"
)

func NewRobotObj(blID int32, role *RoleInfo) *Object {
	obj := &Object{
		BattleLevelId: blID,
		Roles:         map[uint64]*RoleInfo{},
	}

	id := rand.Int31()
	userID := fmt.Sprintf("robot:%d", id)
	obj.Roles[uint64(id)] = NewRobot(uint64(id), userID, role)

	return obj
}

func NewRobot(id uint64, userID string, role *RoleInfo) *RoleInfo {

	return &RoleInfo{
		UserID:      userID,
		RoleID:      uint64(id),
		Level:       role.Level,
		Face:        14011,
		Hair:        14021,
		HairColor:   0,
		EyeColor:    14031,
		Cloth:       14051,
		Outline:     10001,
		Name:        "robot",
		Portrait:    100001,
		BattleAttrs: map[int32]int32{},
		Skills:      []*Skill{},
		RoleType:    com.RoleType_Robot,
	}
}

func init() {
	rand.Seed(time.Now().Unix())
}
